export function getsessionstorage(key) {
  return JSON.parse(sessionStorage.getItem(key));
}
export function removeSessiontorage(key) {
   sessionStorage.removeItem(key)

}
export function setsessionstorage(key, val) {
  let newval = JSON.stringify(val);
  return sessionStorage.setItem(key, newval);
}

export function convertKey(arr, key) {
  let newArr = [];
  arr.forEach((item, index) => {
    let newObj = {};
    for (var i = 0; i < key.length; i++) {
      newObj[key[i]] = item[Object.keys(item)[i]];
    }
    newArr.push(newObj);
  });
  return newArr;
}
